package com.google.code.opengw.http;

public class HTTPCookie {
	private String domain;
	private int maxAge;
	private String name;
	private String path;
	private boolean secure;
	private String value;
	
	public HTTPCookie(String cookieLine){
		int equalIndex = cookieLine.indexOf("=");
		if(equalIndex > -1){
			name = cookieLine.substring(0, equalIndex).trim();
			value = cookieLine.substring(equalIndex + 1).trim();
		} else {
			name = cookieLine;
			value = "";
		}
	}
	
	public String getDomain() {
		return domain;
	}
	public void setDomain(String domain) {
		this.domain = domain;
	}
	public int getMaxAge() {
		return maxAge;
	}
	public void setMaxAge(int maxAge) {
		this.maxAge = maxAge;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public boolean isSecure() {
		return secure;
	}
	public void setSecure(boolean secure) {
		this.secure = secure;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	
	
}
